fix: ship baseline builds for x64 CPUs without AVX2#97
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 2b3f203 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile SummaryThis PR ships non-AVX2 ("baseline") builds of both
Confidence Score: 5/5Safe to merge — the change is purely additive, AVX2-capable machines take the existing fast path, and the detection logic defaults to assume AVX2 present on any error or unrecognized platform. All code paths have explicit exits; the fallback is opt-in only when bunny-baseline / bsql-baseline exists alongside the primary binary; and detection errors are handled conservatively. The only finding is a minor inconsistency between substring matching in the .cjs files and word-boundary matching in the shell script. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[bunny / bsql invoked] --> B{process.arch === x64?}
B -- No --> E[candidates = primary only]
B -- Yes --> C{hasAvx2?}
C -- Yes / error --> E
C -- No --> D{baseline binary exists?}
D -- No --> E
D -- Yes --> F[candidates = baseline, primary]
E --> G[candidates = primary, baseline?]
G -->|baseline exists| H[candidates = primary, baseline]
G -->|no baseline| I[candidates = primary only]
F --> J[Spawn first candidate]
H --> J
I --> J
J --> K{exit code?}
K -- 0 --> L[process.exit 0]
K -- non-zero --> M[process.exit status]
K -- SIGILL + more candidates --> N[Spawn next candidate]
N --> K
K -- SIGILL + no more candidates --> O[Error: CPU not supported]
K -- other signal/error --> P[Error: failed to execute]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[bunny / bsql invoked] --> B{process.arch === x64?}
B -- No --> E[candidates = primary only]
B -- Yes --> C{hasAvx2?}
C -- Yes / error --> E
C -- No --> D{baseline binary exists?}
D -- No --> E
D -- Yes --> F[candidates = baseline, primary]
E --> G[candidates = primary, baseline?]
G -->|baseline exists| H[candidates = primary, baseline]
G -->|no baseline| I[candidates = primary only]
F --> J[Spawn first candidate]
H --> J
I --> J
J --> K{exit code?}
K -- 0 --> L[process.exit 0]
K -- non-zero --> M[process.exit status]
K -- SIGILL + more candidates --> N[Spawn next candidate]
N --> K
K -- SIGILL + no more candidates --> O[Error: CPU not supported]
K -- other signal/error --> P[Error: failed to execute]
Reviews (2): Last reviewed commit: "address comments" | Re-trigger Greptile |
A user #96 on a 2012 Xeon (ThinkStation C30) hit
Illegal instruction (core dumped)from both the installer and npm. Our binaries are compiled with Bun's default x64 target, which requires AVX2 — an instruction set that CPUs older than ~2013 (Sandy/Ivy Bridge) don't have. Same root cause as anthropics/claude-code#50684macOS x64 baseline is intentional. Bun's docs say you "usually don't need" it on Darwin x64, but the linked claude-code issue was a pre-Haswell Intel Mac, so belt and braces.